
(require 'eglot)
(add-to-list 'eglot-server-programs '((c++-mode c-mode) "clangd"))
(add-hook 'c-mode-hook #'eglot-ensure)
(add-hook 'c++-mode-hook #'eglot-ensure)

(use-package quickrun
    :ensure t
    :commands (quickrun)
    :init
    (quickrun-add-command "c++/c1z"
    '((:command . "g++")
	(:exec . ("%c -std=c++1z %o -o %e %s"
		"%e %a"))
	(:remove . ("%e")))
    :default "c++"))

(global-set-key (kbd "<f5>") 'quickrun)

(use-package treesit-auto
  :demand
  :init
  (progn
    (setq treesit-font-lock-level 4)
    )
  :config
  (global-treesit-auto-mode)
  )

(use-package yasnippet
  :ensure t
  :hook ((prog-mode . yas-minor-mode)
         (org-mode . yas-minor-mode))
  :init
  :config
  (progn
    (setq hippie-expand-try-functions-list
          '(yas/hippie-try-expand
            try-complete-file-name-partially
            try-expand-all-abbrevs
            try-expand-dabbrev
            try-expand-dabbrev-all-buffers
            try-expand-dabbrev-from-kill
            try-complete-lisp-symbol-partially
            try-complete-lisp-symbol))))

(use-package yasnippet-snippets
  :ensure t
  :after yasnippet)



(provide 'init-programming)
